<!DOCTYPE html>












  


<html class="theme-next gemini use-motion" lang="zh-CN">
<head><meta name="generator" content="Hexo 3.9.0">
  <!-- hexo-inject:begin --><!-- hexo-inject:end --><meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">












  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=7.2.0">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=7.2.0">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=7.2.0">


  <link rel="mask-icon" href="/images/logo.svg?v=7.2.0" color="#222">






<link rel="stylesheet" href="/css/main.css?v=7.2.0">






<link rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css?v=4.7.0">








<script id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Gemini',
    version: '7.2.0',
    sidebar: {"position":"left","display":"post","offset":12,"onmobile":false},
    back2top: {"enable":true,"sidebar":false,"scrollpercent":false},
    copycode: {"enable":false,"show_result":false,"style":null},
    fancybox: false,
    mediumzoom: false,
    lazyload: false,
    pangu: false,
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    },
    localsearch: {"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},
    search: {
      root: '/',
      path: ''
    },
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    translation: {
      copy_button: '复制',
      copy_success: '复制成功',
      copy_failure: '复制失败'
    }
  };
</script>

  <meta name="description" content="I&apos;m a bluetooth Host and Controller developer">
<meta name="keywords" content="bluetooth, reading, thinking">
<meta property="og:type" content="website">
<meta property="og:title" content="Wen Wu&#39;s notes">
<meta property="og:url" content="http://yoursite.com/page/6/index.html">
<meta property="og:site_name" content="Wen Wu&#39;s notes">
<meta property="og:description" content="I&apos;m a bluetooth Host and Controller developer">
<meta property="og:locale" content="zh-CN">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Wen Wu&#39;s notes">
<meta name="twitter:description" content="I&apos;m a bluetooth Host and Controller developer">





  
  
  <link rel="canonical" href="http://yoursite.com/page/6/">



<script id="page.configurations">
  CONFIG.page = {
    sidebar: "",
  };
</script>

  
  <title>Wen Wu's notes</title>
  












  <noscript>
  <style>
  .use-motion .motion-element,
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-title { opacity: initial; }

  .use-motion .logo,
  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript><!-- hexo-inject:begin --><!-- hexo-inject:end -->

</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-CN">

  
  
    
  

  <!-- hexo-inject:begin --><!-- hexo-inject:end --><div class="container sidebar-position-left 
  page-home">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta">
    

    <div class="custom-logo-site-title">
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">Wen Wu's notes</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
    
      
        <p class="site-subtitle">technical record</p>
      
    
    
  </div>

  <div class="site-nav-toggle">
    <button aria-label="切换导航栏">
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>



<nav class="site-nav">
  
    <ul id="menu" class="menu">
      
        
        
        
          
          <li class="menu-item menu-item-home">

    
    
      
    

    

    <a href="/" rel="section"><i class="menu-item-icon fa fa-fw fa-home"></i> <br>首页</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-about">

    
    
      
    

    

    <a href="/about/" rel="section"><i class="menu-item-icon fa fa-fw fa-user"></i> <br>关于</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-tags">

    
    
      
    

    

    <a href="/tags/" rel="section"><i class="menu-item-icon fa fa-fw fa-tags"></i> <br>标签</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-categories">

    
    
      
    

    

    <a href="/categories/" rel="section"><i class="menu-item-icon fa fa-fw fa-th"></i> <br>分类</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-archives">

    
    
      
    

    

    <a href="/archives/" rel="section"><i class="menu-item-icon fa fa-fw fa-archive"></i> <br>归档</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-schedule">

    
    
      
    

    

    <a href="/schedule/" rel="section"><i class="menu-item-icon fa fa-fw fa-calendar"></i> <br>日程表</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-sitemap">

    
    
      
    

    

    <a href="/sitemap.xml" rel="section"><i class="menu-item-icon fa fa-fw fa-sitemap"></i> <br>站点地图</a>

  </li>

      
      
    </ul>
  

  

  
</nav>



</div>
    </header>

    


    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          
            

          
          <div id="content" class="content">
            
  <section id="posts" class="posts-expand">
    
        

  
  
  

  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2019/08/17/bt-audio-codec/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Wen Wu">
      <meta itemprop="description" content="I'm a bluetooth Host and Controller developer">
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Wen Wu's notes">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
                
                
                <a href="/2019/08/17/bt-audio-codec/" class="post-title-link" itemprop="url">BT Codec 总结</a>
              
            
          </h1>
        

        <div class="post-meta">

          
          
          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              

              
                
              

              <time title="创建时间：2019-08-17 20:55:51" itemprop="dateCreated datePublished" datetime="2019-08-17T20:55:51+08:00">2019-08-17</time>
            </span>
          

          

          

          
          
            <span id="/2019/08/17/bt-audio-codec/" class="post-meta-item leancloud_visitors" data-flag-title="BT Codec 总结">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              
                <span class="post-meta-item-text">阅读次数：</span>
              
                <span class="leancloud-visitors-count"></span>
            </span>
          

          

          
            
  
  <span class="post-meta-item">
    
    <span class="post-meta-item-icon">
      <i class="fa fa-comment-o"></i>
    </span>
    
      <span class="post-meta-item-text">评论数：</span>
    
  
    <a href="/2019/08/17/bt-audio-codec/#comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2019/08/17/bt-audio-codec/" itemprop="commentCount"></span>
    </a>
  </span>
  
  
          

          <br>
          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
            <p>开发BT audio，经常被各种BT music 断音，跳音等等问题而困扰，大部分都是因为codec出问题或是bt受干扰而throughput不够。<br>针对BT music使用到的codec，这篇文章有做一些总结。<a href="https://www.soundguys.com/understanding-bluetooth-codecs-15352/">Understanding Bluetooth codecs</a></p>
<p> <img src="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/BluetoothCodec/bt_codec_pors.png" alt="Bluetooth Codec PK" title="Codec PK"></p>
<p> <img src="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/BluetoothCodec/blueooth-codec-transfer-rate.png" alt="Bluetooth Codec transfer rate" title="throughput"></p>
<p> <img src="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/BluetoothCodec/bluetooth-codec-latency.png" alt="Bluetooth Codec latency" title="Latency"></p>

          
        
      
    </div>

    

    

    
    
    

    

    
      
    
    

    

    <footer class="post-footer">
      

      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </div>
  
  
  
  </article>

    
        

  
  
  

  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2019/08/04/google-test/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Wen Wu">
      <meta itemprop="description" content="I'm a bluetooth Host and Controller developer">
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Wen Wu's notes">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
                
                
                <a href="/2019/08/04/google-test/" class="post-title-link" itemprop="url">测试之道</a>
              
            
          </h1>
        

        <div class="post-meta">

          
          
          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              

              
                
              

              <time title="创建时间：2019-08-04 22:02:04" itemprop="dateCreated datePublished" datetime="2019-08-04T22:02:04+08:00">2019-08-04</time>
            </span>
          

          

          

          
          
            <span id="/2019/08/04/google-test/" class="post-meta-item leancloud_visitors" data-flag-title="测试之道">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              
                <span class="post-meta-item-text">阅读次数：</span>
              
                <span class="leancloud-visitors-count"></span>
            </span>
          

          

          
            
  
  <span class="post-meta-item">
    
    <span class="post-meta-item-icon">
      <i class="fa fa-comment-o"></i>
    </span>
    
      <span class="post-meta-item-text">评论数：</span>
    
  
    <a href="/2019/08/04/google-test/#comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2019/08/04/google-test/" itemprop="commentCount"></span>
    </a>
  </span>
  
  
          

          <br>
          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
            <p>Google认为tester是为了帮助RD提高生产效率的，并不是为了把关什么软件质量，只有RD才能真正把关质量。<br>由于公司是IC 设计公司，所有的软件定义都是为IC 服务，软件开发时程也是紧跟硬件的时程。SW RD的产出有很大一部分时候需要靠QA来帮忙做测试抓问题，而不是RD自己把code写的铜墙铁壁，没有漏洞。。反过来说，对RD也是一个很大的考验，如何在短时间内高质量完成自己的部分，而且不over design。</p>

          
        
      
    </div>

    

    

    
    
    

    

    
      
    
    

    

    <footer class="post-footer">
      

      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </div>
  
  
  
  </article>

    
        

  
  
  

  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2019/07/28/communication-study/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Wen Wu">
      <meta itemprop="description" content="I'm a bluetooth Host and Controller developer">
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Wen Wu's notes">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
                
                
                <a href="/2019/07/28/communication-study/" class="post-title-link" itemprop="url">通信相关的文章收集</a>
              
            
          </h1>
        

        <div class="post-meta">

          
          
          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              

              
                
              

              <time title="创建时间：2019-07-28 21:22:50" itemprop="dateCreated datePublished" datetime="2019-07-28T21:22:50+08:00">2019-07-28</time>
            </span>
          

          

          

          
          
            <span id="/2019/07/28/communication-study/" class="post-meta-item leancloud_visitors" data-flag-title="通信相关的文章收集">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              
                <span class="post-meta-item-text">阅读次数：</span>
              
                <span class="leancloud-visitors-count"></span>
            </span>
          

          

          
            
  
  <span class="post-meta-item">
    
    <span class="post-meta-item-icon">
      <i class="fa fa-comment-o"></i>
    </span>
    
      <span class="post-meta-item-text">评论数：</span>
    
  
    <a href="/2019/07/28/communication-study/#comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2019/07/28/communication-study/" itemprop="commentCount"></span>
    </a>
  </span>
  
  
          

          <br>
          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
            <p>IQ调制：<a href="http://blog.chinaaet.com/molf/p/29748">http://blog.chinaaet.com/molf/p/29748</a></p>
<p>通信介绍：<a href="https://zhuanlan.zhihu.com/p/23612006">https://zhuanlan.zhihu.com/p/23612006</a></p>
<p><a href="https://www.cnblogs.com/shaoyou/p/4822222.html">https://www.cnblogs.com/shaoyou/p/4822222.html</a></p>
<p><a href="https://en.wikipedia.org/wiki/File:Fourier_series_and_transform.gif">https://en.wikipedia.org/wiki/File:Fourier_series_and_transform.gif</a></p>
<p><a href="https://en.wikipedia.org/wiki/File:Fourier_series_square_wave_circles_animation.gif">https://en.wikipedia.org/wiki/File:Fourier_series_square_wave_circles_animation.gif</a><br><a href="https://en.wikipedia.org/wiki/File:Fourier_series_sawtooth_wave_circles_animation.gif">https://en.wikipedia.org/wiki/File:Fourier_series_sawtooth_wave_circles_animation.gif</a></p>

          
        
      
    </div>

    

    

    
    
    

    

    
      
    
    

    

    <footer class="post-footer">
      

      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </div>
  
  
  
  </article>

    
        

  
  
  

  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2019/07/27/linux-command/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Wen Wu">
      <meta itemprop="description" content="I'm a bluetooth Host and Controller developer">
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Wen Wu's notes">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
                
                
                <a href="/2019/07/27/linux-command/" class="post-title-link" itemprop="url">linux usage command</a>
              
            
          </h1>
        

        <div class="post-meta">

          
          
          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              

              
                
              

              <time title="创建时间：2019-07-27 23:23:02 / 修改时间：23:23:23" itemprop="dateCreated datePublished" datetime="2019-07-27T23:23:02+08:00">2019-07-27</time>
            </span>
          

          
            

            
          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing"><a href="/categories/Linux/" itemprop="url" rel="index"><span itemprop="name">Linux</span></a></span>

                
                
              
            </span>
          

          
          
            <span id="/2019/07/27/linux-command/" class="post-meta-item leancloud_visitors" data-flag-title="linux usage command">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              
                <span class="post-meta-item-text">阅读次数：</span>
              
                <span class="leancloud-visitors-count"></span>
            </span>
          

          

          
            
  
  <span class="post-meta-item">
    
    <span class="post-meta-item-icon">
      <i class="fa fa-comment-o"></i>
    </span>
    
      <span class="post-meta-item-text">评论数：</span>
    
  
    <a href="/2019/07/27/linux-command/#comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2019/07/27/linux-command/" itemprop="commentCount"></span>
    </a>
  </span>
  
  
          

          <br>
          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
            <h2 id="文件重命名"><a href="#文件重命名" class="headerlink" title="文件重命名"></a>文件重命名</h2><blockquote>
<p>mv a.xxx b.png</p>
</blockquote>
<h2 id="压缩文件"><a href="#压缩文件" class="headerlink" title="压缩文件"></a>压缩文件</h2><h2 id="搜索文件"><a href="#搜索文件" class="headerlink" title="搜索文件"></a>搜索文件</h2>
          
        
      
    </div>

    

    

    
    
    

    

    
      
    
    

    

    <footer class="post-footer">
      

      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </div>
  
  
  
  </article>

    
        

  
  
  

  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2019/07/27/bluetooth-packets/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Wen Wu">
      <meta itemprop="description" content="I'm a bluetooth Host and Controller developer">
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Wen Wu's notes">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
                
                
                <a href="/2019/07/27/bluetooth-packets/" class="post-title-link" itemprop="url">蓝牙数据包</a>
              
            
          </h1>
        

        <div class="post-meta">

          
          
          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              

              
                
              

              <time title="创建时间：2019-07-27 23:07:46 / 修改时间：23:23:23" itemprop="dateCreated datePublished" datetime="2019-07-27T23:07:46+08:00">2019-07-27</time>
            </span>
          

          
            

            
          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing"><a href="/categories/蓝牙/" itemprop="url" rel="index"><span itemprop="name">蓝牙</span></a></span>

                
                
              
            </span>
          

          
          
            <span id="/2019/07/27/bluetooth-packets/" class="post-meta-item leancloud_visitors" data-flag-title="蓝牙数据包">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              
                <span class="post-meta-item-text">阅读次数：</span>
              
                <span class="leancloud-visitors-count"></span>
            </span>
          

          

          
            
  
  <span class="post-meta-item">
    
    <span class="post-meta-item-icon">
      <i class="fa fa-comment-o"></i>
    </span>
    
      <span class="post-meta-item-text">评论数：</span>
    
  
    <a href="/2019/07/27/bluetooth-packets/#comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2019/07/27/bluetooth-packets/" itemprop="commentCount"></span>
    </a>
  </span>
  
  
          

          <br>
          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
            <h1 id="BR-EDR-packets"><a href="#BR-EDR-packets" class="headerlink" title="BR/EDR packets"></a>BR/EDR packets</h1><p> <img src="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/Bluetooth_packets/EDR_pkt_type.png" alt="EDR packet type" title="BR/EDR packet type"></p>
<h1 id="BLE-packets"><a href="#BLE-packets" class="headerlink" title="BLE packets"></a>BLE packets</h1><h2 id="LE-uncoded-PHY"><a href="#LE-uncoded-PHY" class="headerlink" title="LE uncoded PHY"></a>LE uncoded PHY</h2><p>  <img src="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/Bluetooth_packets/LE_Uncoded_PHYs_pkt_type.png" alt="LE Uncoded PHY packet type"></p>
<h2 id="LE-coded-PHY"><a href="#LE-coded-PHY" class="headerlink" title="LE coded PHY"></a>LE coded PHY</h2><p>  <img src="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/Bluetooth_packets/LE_Coded_PHY_packet_format.png" alt="LE coded PHY packet type"></p>
<blockquote>
<p>CI: Coding indicator, </p>
<blockquote>
<p>00b: S=8, 01B: S=2<br>TERM1: terminator of FEC block 1<br>TERM2: terminator of FED block 2</p>
</blockquote>
</blockquote>
<p>  <img src="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/Bluetooth_packets/LE_Coded_PHY_field_size.png" alt="LE coded PHY packet type"></p>

          
        
      
    </div>

    

    

    
    
    

    

    
      
    
    

    

    <footer class="post-footer">
      

      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </div>
  
  
  
  </article>

    
        

  
  
  

  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2019/07/27/bluetooth-baseband/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Wen Wu">
      <meta itemprop="description" content="I'm a bluetooth Host and Controller developer">
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Wen Wu's notes">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
                
                
                <a href="/2019/07/27/bluetooth-baseband/" class="post-title-link" itemprop="url">蓝牙基带介绍</a>
              
            
          </h1>
        

        <div class="post-meta">

          
          
          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              

              
                
              

              <time title="创建时间：2019-07-27 11:16:47" itemprop="dateCreated datePublished" datetime="2019-07-27T11:16:47+08:00">2019-07-27</time>
            </span>
          

          
            

            
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                
                  <span class="post-meta-item-text">更新于</span>
                
                <time title="修改时间：2019-09-18 07:59:31" itemprop="dateModified" datetime="2019-09-18T07:59:31+08:00">2019-09-18</time>
              </span>
            
          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing"><a href="/categories/蓝牙/" itemprop="url" rel="index"><span itemprop="name">蓝牙</span></a></span>

                
                
              
            </span>
          

          
          
            <span id="/2019/07/27/bluetooth-baseband/" class="post-meta-item leancloud_visitors" data-flag-title="蓝牙基带介绍">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              
                <span class="post-meta-item-text">阅读次数：</span>
              
                <span class="leancloud-visitors-count"></span>
            </span>
          

          

          
            
  
  <span class="post-meta-item">
    
    <span class="post-meta-item-icon">
      <i class="fa fa-comment-o"></i>
    </span>
    
      <span class="post-meta-item-text">评论数：</span>
    
  
    <a href="/2019/07/27/bluetooth-baseband/#comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2019/07/27/bluetooth-baseband/" itemprop="commentCount"></span>
    </a>
  </span>
  
  
          

          <br>
          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
            <p>对于任何一门知识体系，一定有一个最小基本单位，基本概念，其他的概念或是规矩都是基于这几个基本的东西在玩花样。对于这个很基本的分析问题的方法，混沌大学的李善友老师还起来一个非常高大上的名字叫做“唯一性原理”，有点故弄玄虚，其实叫啥无所谓，面对同样一份原始数据，如果你有相关的知识，你就能将数据切的更细，那就能看到更多东西。</p>
<p>先列举下Baseband的几个基本单位：</p>
<h2 id="1-Piconet"><a href="#1-Piconet" class="headerlink" title="1. Piconet"></a>1. Piconet</h2><p>  跟其他网络技术一样，蓝牙也有自己的网络。网上把这个单词翻译成微网。在蓝牙设备没有跟其他蓝牙设备连线的时候，它自己属于一个piconet。当有连线后，piconet里有两种角色：master 和 slave。发起连线的一方是master，被连接的一方是slave。slave会以master的时钟为参照，以625us为时间单位，与master进行数据收发。每一个piconet里，一个master最多有7个slave。<br>  <img src="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/Spec.Vol1.BluetoothBasic/BREDR_Topology.png" alt="Piconet" title="PicoNet"></p>
<h2 id="2-Mode"><a href="#2-Mode" class="headerlink" title="2. Mode"></a>2. Mode</h2><p>  这里的Mode其实对应的是Modem，数据编码不同，那Modem就不同，传输数据的速度也不同。</p>
<h3 id="2-1-Basic-Rate：最基本的一种模式，采用BPSK，传输速率是-1Mb-s。"><a href="#2-1-Basic-Rate：最基本的一种模式，采用BPSK，传输速率是-1Mb-s。" class="headerlink" title="2.1 Basic Rate：最基本的一种模式，采用BPSK，传输速率是 1Mb/s。"></a>2.1 Basic Rate：最基本的一种模式，采用BPSK，传输速率是 1Mb/s。</h3><h3 id="2-2-Enhanced-Data-Rate：增强模式，传输速率是-2Mb-s-（π-4-DQPSK）或-3Mb-s（8DPSK），这种模式有两种编码。"><a href="#2-2-Enhanced-Data-Rate：增强模式，传输速率是-2Mb-s-（π-4-DQPSK）或-3Mb-s（8DPSK），这种模式有两种编码。" class="headerlink" title="2.2 Enhanced Data Rate：增强模式，传输速率是 2Mb/s （π/4-DQPSK）或 3Mb/s（8DPSK），这种模式有两种编码。"></a>2.2 Enhanced Data Rate：增强模式，传输速率是 2Mb/s （π/4-DQPSK）或 3Mb/s（8DPSK），这种模式有两种编码。</h3><h2 id="3-BT-clock"><a href="#3-BT-clock" class="headerlink" title="3. BT clock"></a>3. BT clock</h2><p>  Clock是蓝牙通信最最基础的一个概念，clock定义了通信的时空范围，定义了这个Piconet时空的坐标系，只有在同一个坐标系里，网络内的各个角色才能相互了解对方的时间线，才知道什么时候发包，什么时候收包。<br>  BT clock是个28bit的计数器，每tick一次是312.5us，所以总共有 (2^28 -1)个tick，算一下大约是(2^28-1)*312.5us/10^6/3600 = 23.3个小时后clock会翻转。<br>  <img src="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/BluetoothBaseband/BaseBand_BluetoothClock.png" alt="BT Clock" title="BT Clock"><br>  针对clock有几个概念也要知道下：</p>
<blockquote>
<p>CLK0, 312.5us，是一个tick<br>CLK1, 625us, 是一个slot<br>CLK2, 1.25ms, 是一个frame（做一次TX 和 RX）<br>CLK12, 1.28s.<br>  Clock的精确度要求为 +/-250ppm 和 +/-20ppm</p>
</blockquote>
<h2 id="4-BT-地址"><a href="#4-BT-地址" class="headerlink" title="4. BT 地址"></a>4. BT 地址</h2><p>  蓝牙地址有48bit，需要跟IEEE去购买。<br>  <img src="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/BluetoothBaseband/BluetoothAddr.png" alt="BDA" title="BD Address"><br>  LAP中有64个：0x9E8B00-0x9E8B3F是用来做inquiry的。0x9E8B000 是用来做 General inquiry，余下的63个是用来做Dedicate inquiry。当保留LAP被使用的时候，UAP会是0x00，Default Check Initialization。</p>
<h2 id="5-Access-Code"><a href="#5-Access-Code" class="headerlink" title="5. Access Code"></a>5. Access Code</h2><p>  所有的蓝牙数据包都以access code为开头，所有的access code是从LAP生出来的。access code是为了告诉对方，数据包来了，该做准备了，而接收方也可以根据access code来确定这包数据是不是属于自己的。</p>
<blockquote>
<p>device access code (DAC)<br>channel access code (CAC)<br>Inquiry access code (IAC)</p>
<blockquote>
<p>IAC 又分为 GIAC 和 DIAC</p>
</blockquote>
</blockquote>
<h2 id="6-Physical-Channel（信道）"><a href="#6-Physical-Channel（信道）" class="headerlink" title="6. Physical Channel（信道）"></a>6. Physical Channel（信道）</h2><p>  蓝牙有79个信道,每个信道2M<br>  <img src="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/BluetoothBaseband/baseband_79_Channels.png" alt="79 Channels" title="bluetooth channels"><br>  Spec总共有定义如下5种channel</p>
<blockquote>
<p>Basic piconet physical channel<br>Adapted piconet physical channel<br>Page scan physical channel<br>Inquiry scan physical channel<br>Synchronization scan physical channel</p>
</blockquote>
<h3 id="6-1-Basic-piconet-physical-channel"><a href="#6-1-Basic-piconet-physical-channel" class="headerlink" title="6.1 Basic piconet physical channel"></a>6.1 Basic piconet physical channel</h3><p>   在建立连线后，Slave会以Mater的clock为准。Master和Slave以一个slot为单位进行Tx和Rx，Master在clock为偶数时发包，Slave在clock为偶数时收包，如下面的两张图。<br>  <img src="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/BluetoothBaseband/BaseBand_Master_TXRX_Cycle.png" alt="MasterCycle" title="Master Tx/Rx Cycle"><br>  <img src="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/BluetoothBaseband/Baseband_Slave_RxTx_cycle.png" alt="Slave Cyle" title="Slave Rx/Tx Cycle"><br>   为了处理time sliping，定义uncertainty window来增加Rx的时候收到包的几率，Slave可以加大自己的Rx时间uncertainty window来提高收到包的几率。<br>   如果在250ms内等不到Master的包，那Slave就只能认为是短线了。</p>
<h3 id="6-2-Adapted-piconet-phycial-channel"><a href="#6-2-Adapted-piconet-phycial-channel" class="headerlink" title="6.2 Adapted piconet phycial channel"></a>6.2 Adapted piconet phycial channel</h3><p>   用到的channel个数可能会少于79个，不过至少会是20个。</p>
<h3 id="6-4-Page-scan-phycial-channel"><a href="#6-4-Page-scan-phycial-channel" class="headerlink" title="6.4 Page scan phycial channel"></a>6.4 Page scan phycial channel</h3><p>   在Paging的时候，Master会发送paging message（就是ID packets），这个时候的跳频速度是 3200 hops/s，在Tx的slot内会打两次包，在Rx的Slot内也会收两次Slave的回应。<br>   Slave在收到Master的paging messagse后的625us会回一个slave reponse packet。Master在收到这个reponse packet的后面的那个Tx slock再发一个master page reponse packet。<br>  <img src="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/BluetoothBaseband/Baseband-PageScanRxTxCycle.png" alt="Page Scan Channel" title="PageScan"><br>  <img src="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/BluetoothBaseband/Baseband-PageScanInFirstHalfSlot.png" alt="Page Scan at 1st half slot" title="1st half slot"><br>  <img src="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/BluetoothBaseband/Baseband-PageScanIn2ndHalfSlot.png" alt="Page at 2nd half slot" title="2nd half slot"></p>
<h3 id="6-5-Inquiry-Scan-Physical-channel"><a href="#6-5-Inquiry-Scan-Physical-channel" class="headerlink" title="6.5 Inquiry Scan Physical channel"></a>6.5 Inquiry Scan Physical channel</h3><p>  在Inquiry的时候，Master会一直发送inquiry mesasge，带上GIAC 或 DIAC。<br>   <img src="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/BluetoothBaseband/Baseband-InquiryScanAt1stHalfSlot.png" alt="Inquiry Scan" title="Inquiry Scan at 1st half"><br>   <img src="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/BluetoothBaseband/Baseband-InquiryScanAt2ndHalfSlot.png" alt="Inquiry Scan 2" title="Inquiry Scan at 2nd half"></p>
<h2 id="7-HOP-Seletion-（跳频）"><a href="#7-HOP-Seletion-（跳频）" class="headerlink" title="7. HOP Seletion （跳频）"></a>7. HOP Seletion （跳频）</h2><p>  据说跳频的理论模型还是个<a href="https://www.sohu.com/a/144238786_693721">演员</a>发明的。</p>
<h3 id="7-1-Selection-Kernel"><a href="#7-1-Selection-Kernel" class="headerlink" title="7.1 Selection Kernel"></a>7.1 Selection Kernel</h3><p>  <img src="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/BluetoothBaseband/Baseband-SelectionKernelOfHoppingSystem.png" alt="Selection Kernel" title="Selection Kernel"><br>  <img src="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/BluetoothBaseband/Baseband-SelectionKernelHopSystemControlWord.png" alt="Control word" title="Control word"></p>

          
        
      
    </div>

    

    

    
    
    

    

    
      
    
    

    

    <footer class="post-footer">
      

      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </div>
  
  
  
  </article>

    
        

  
  
  

  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2019/07/21/software-management/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Wen Wu">
      <meta itemprop="description" content="I'm a bluetooth Host and Controller developer">
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Wen Wu's notes">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
                
                
                <a href="/2019/07/21/software-management/" class="post-title-link" itemprop="url">软件工程</a>
              
            
          </h1>
        

        <div class="post-meta">

          
          
          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              

              
                
              

              <time title="创建时间：2019-07-21 22:45:40" itemprop="dateCreated datePublished" datetime="2019-07-21T22:45:40+08:00">2019-07-21</time>
            </span>
          

          
            

            
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                
                  <span class="post-meta-item-text">更新于</span>
                
                <time title="修改时间：2019-08-04 22:01:36" itemprop="dateModified" datetime="2019-08-04T22:01:36+08:00">2019-08-04</time>
              </span>
            
          

          

          
          
            <span id="/2019/07/21/software-management/" class="post-meta-item leancloud_visitors" data-flag-title="软件工程">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              
                <span class="post-meta-item-text">阅读次数：</span>
              
                <span class="leancloud-visitors-count"></span>
            </span>
          

          

          
            
  
  <span class="post-meta-item">
    
    <span class="post-meta-item-icon">
      <i class="fa fa-comment-o"></i>
    </span>
    
      <span class="post-meta-item-text">评论数：</span>
    
  
    <a href="/2019/07/21/software-management/#comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2019/07/21/software-management/" itemprop="commentCount"></span>
    </a>
  </span>
  
  
          

          <br>
          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
            <p>软件工程就是努力交付加上与客户斗智斗勇的一个过程。</p>
<p> <img src="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/SoftwareManage/software-req-1.png" alt="软件需求铁三角"></p>
<p> <img src="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/SoftwareManage/software-req-2.png" alt="需求与开发"></p>

          
        
      
    </div>

    

    

    
    
    

    

    
      
    
    

    

    <footer class="post-footer">
      

      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </div>
  
  
  
  </article>

    
        

  
  
  

  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2019/07/17/bluetooth-basic/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Wen Wu">
      <meta itemprop="description" content="I'm a bluetooth Host and Controller developer">
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Wen Wu's notes">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
                
                
                <a href="/2019/07/17/bluetooth-basic/" class="post-title-link" itemprop="url">Bluetooth Topology</a>
              
            
          </h1>
        

        <div class="post-meta">

          
          
          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              

              
                
              

              <time title="创建时间：2019-07-17 21:27:34" itemprop="dateCreated datePublished" datetime="2019-07-17T21:27:34+08:00">2019-07-17</time>
            </span>
          

          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing"><a href="/categories/蓝牙/" itemprop="url" rel="index"><span itemprop="name">蓝牙</span></a></span>

                
                
              
            </span>
          

          
          
            <span id="/2019/07/17/bluetooth-basic/" class="post-meta-item leancloud_visitors" data-flag-title="Bluetooth Topology">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              
                <span class="post-meta-item-text">阅读次数：</span>
              
                <span class="leancloud-visitors-count"></span>
            </span>
          

          

          
            
  
  <span class="post-meta-item">
    
    <span class="post-meta-item-icon">
      <i class="fa fa-comment-o"></i>
    </span>
    
      <span class="post-meta-item-text">评论数：</span>
    
  
    <a href="/2019/07/17/bluetooth-basic/#comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2019/07/17/bluetooth-basic/" itemprop="commentCount"></span>
    </a>
  </span>
  
  
          

          <br>
          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
            <h1 id="BR-EDR-Topology"><a href="#BR-EDR-Topology" class="headerlink" title="BR/EDR Topology"></a>BR/EDR Topology</h1><p> <img src="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/Spec.Vol1.BluetoothBasic/BREDR_Topology.png" alt="BR/EDR Topology" title="BR/EDR topology"></p>
<h1 id="LE-Topology"><a href="#LE-Topology" class="headerlink" title="LE Topology"></a>LE Topology</h1><p> <img src="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/Spec.Vol1.BluetoothBasic/LE_Topology.png" alt="LE Topology" title="LE Topology"></p>

          
        
      
    </div>

    

    

    
    
    

    

    
      
    
    

    

    <footer class="post-footer">
      

      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </div>
  
  
  
  </article>

    
        

  
  
  

  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2019/07/13/google-fast-pair/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Wen Wu">
      <meta itemprop="description" content="I'm a bluetooth Host and Controller developer">
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Wen Wu's notes">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
                
                
                <a href="/2019/07/13/google-fast-pair/" class="post-title-link" itemprop="url">Google Fast Pair</a>
              
            
          </h1>
        

        <div class="post-meta">

          
          
          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              

              
                
              

              <time title="创建时间：2019-07-13 17:22:32 / 修改时间：17:23:33" itemprop="dateCreated datePublished" datetime="2019-07-13T17:22:32+08:00">2019-07-13</time>
            </span>
          

          
            

            
          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing"><a href="/categories/蓝牙/" itemprop="url" rel="index"><span itemprop="name">蓝牙</span></a></span>

                
                
              
            </span>
          

          
          
            <span id="/2019/07/13/google-fast-pair/" class="post-meta-item leancloud_visitors" data-flag-title="Google Fast Pair">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              
                <span class="post-meta-item-text">阅读次数：</span>
              
                <span class="leancloud-visitors-count"></span>
            </span>
          

          

          
            
  
  <span class="post-meta-item">
    
    <span class="post-meta-item-icon">
      <i class="fa fa-comment-o"></i>
    </span>
    
      <span class="post-meta-item-text">评论数：</span>
    
  
    <a href="/2019/07/13/google-fast-pair/#comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2019/07/13/google-fast-pair/" itemprop="commentCount"></span>
    </a>
  </span>
  
  
          

          <br>
          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
            <p><a href="https://developers.google.com/nearby/fast-pair/spec">官网规范</a><br>  由于蓝牙设备在使用上有配对的流程，对于没有UI的设备来说，非常的不方便或是不安全。像Apple的Airpod，只要打开盒子，Apple的手机自动就弹出画面，只要点击一下就完成配对，非常的方便。<br>所以Google也在Android上搞了一个类似的东西，叫做Fast Pair。目前前几名的<a href="https://developers.google.com/nearby/fast-pair/chipsets">蓝牙大佬</a>已经支持了。<br>  本文就介绍Google Fast Pair (GFPS) 的基本原理。</p>
<h1 id="基本原理"><a href="#基本原理" class="headerlink" title="基本原理"></a>基本原理</h1><p> 首先厂商需要到<a href="https://developers.google.com/nearby/devices/?refresh=1">Nearby Devie</a>注册自己的支持Google Fast Pair的设备，Nearby Device会分配Modle ID 和public key 及private key给该设备。<br> 设备端通过BLE advertising广播自己的身份信息，当手机端发现搜索到的广播信息里表面设备支持GFPS，而且能认出该设备广播的modle ID的时候，就发起BLE连线到该设备，设备端发送其BR/EDR地址给手机，发送的数据是加密过的，手机拿到地址后发起BR/EDR连线，触发配对等流程，等BR/EDR连线都完成后，BLE连线就断开，整个Fast pair流程就结束。<br> 整个过程，只有手机在发现支持GFPS的设备的时候，询问用户是否要连线，用户只要点击一下就行。</p>
<h1 id="技术细节"><a href="#技术细节" class="headerlink" title="技术细节"></a>技术细节</h1><h2 id="角色定义"><a href="#角色定义" class="headerlink" title="角色定义"></a>角色定义</h2><h3 id="Seeker：手机端"><a href="#Seeker：手机端" class="headerlink" title="Seeker：手机端"></a>Seeker：手机端</h3><h3 id="Provider：设备端"><a href="#Provider：设备端" class="headerlink" title="Provider：设备端"></a>Provider：设备端</h3><h4 id="1-设备要首先要到Google-nearby-device去注册，这样Android才能识别出来。"><a href="#1-设备要首先要到Google-nearby-device去注册，这样Android才能识别出来。" class="headerlink" title="1. 设备要首先要到Google nearby device去注册，这样Android才能识别出来。"></a>1. 设备要首先要到Google nearby device去注册，这样Android才能识别出来。</h4><p>设备的TX power设定有讲究</p>
<h4 id="2-Power设定应该比较小，目标是离SP-1m内可被搜到-Google建议的设定方法："><a href="#2-Power设定应该比较小，目标是离SP-1m内可被搜到-Google建议的设定方法：" class="headerlink" title="2. Power设定应该比较小，目标是离SP 1m内可被搜到.Google建议的设定方法："></a>2. Power设定应该比较小，目标是离SP 1m内可被搜到.Google建议的设定方法：</h4><blockquote>
<p>The best way to determine the value is to measure the actual output of the device using an Android phone at 1 meter away, and then add 41 dBm to that. 41 dBm is the average signal strength loss that occurs over 1 meter.<br>Tx power 可以设定在广播包内，也可以设定在设备注册阶段就添上。<br>如果是在设备注册时就添上了Tx power的话，那所有的广播包都应该用这个Tx Power</p>
<h4 id="3-关于Key"><a href="#3-关于Key" class="headerlink" title="3. 关于Key"></a>3. 关于Key</h4><ol>
<li>反偷听的Public key 和private key（Anti-Spoofing Public/Private Key Pair）<br>Private Key是 256bits，建议保存在安全区域，避免泄露出去<br>Public Key在Seeker端才用得到</li>
<li>Account Key list<br>Account key是为了让Seeker能识别出来这个key是属于某个google账号的。</li>
</ol>
</blockquote>
<h4 id="4-关于Advertising"><a href="#4-关于Advertising" class="headerlink" title="4.关于Advertising"></a>4.关于Advertising</h4><h5 id="在BR-EDR是discoverable时的Advertising设定："><a href="#在BR-EDR是discoverable时的Advertising设定：" class="headerlink" title="在BR/EDR是discoverable时的Advertising设定："></a>在BR/EDR是discoverable时的Advertising设定：</h5><ol>
<li>在广播包中要加入24bit module ID</li>
<li><strong>Advertising Inerval</strong> &lt;= 100ms</li>
<li>广播时要使用RPA address</li>
<li>Payload里要包含GFPS的service UUID：0xFE2C<h5 id="在BR-EDR是non-discoverable时的Advertising设定"><a href="#在BR-EDR是non-discoverable时的Advertising设定" class="headerlink" title="在BR/EDR是non-discoverable时的Advertising设定"></a>在BR/EDR是non-discoverable时的Advertising设定</h5></li>
<li>在广播包里加入 Account Key，这样Seeker在发现Provider有属于他认识的Account时，可以直接开始Fast Pair</li>
<li>Advertising Interval &lt;= 240ms</li>
<li>广播时也要用RPA地址</li>
<li>Pay load要包含 GFPS的Service UUID 和 Account key list</li>
<li>Account Key Filter<br>为了让Seeker能尽快识别出Provider的广播包里是否有Seeker认识的Account，Provider对Account Key List计算出一个Key filter，Seeker能根据这个filter很快识别出是否有他关心的Account，从而决定是否要发起连线。<br>这个算法的细节后续再加进来。</li>
</ol>
<h4 id="5-GATT-Service"><a href="#5-GATT-Service" class="headerlink" title="5. GATT Service"></a>5. GATT Service</h4><h5 id="5-1-必须有GFPS-Service"><a href="#5-1-必须有GFPS-Service" class="headerlink" title="5.1 必须有GFPS Service"></a>5.1 必须有GFPS Service</h5><div class="table-container">
<table>
<thead>
<tr>
<th>Service</th>
<th>UIID</th>
</tr>
</thead>
<tbody>
<tr>
<td>Fast Pair Service</td>
<td>0xFE2C</td>
</tr>
<tr>
<td>单元格</td>
<td>单元格</td>
</tr>
</tbody>
</table>
</div>
<p>该Serviceyou如下的Charicterristic</p>
<div class="table-container">
<table>
<thead>
<tr>
<th style="text-align:center">Fast Pair Service characteristic</th>
<th style="text-align:center">Encrypted</th>
<th style="text-align:center">Permissions</th>
<th style="text-align:center">UUID</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">Key-based Pairing</td>
<td style="text-align:center">No</td>
<td style="text-align:center">Write and notify</td>
<td style="text-align:center">0x1234</td>
</tr>
<tr>
<td style="text-align:center">Passkey</td>
<td style="text-align:center">No</td>
<td style="text-align:center">Write and notify</td>
<td style="text-align:center">0x1235</td>
</tr>
<tr>
<td style="text-align:center">Account Key</td>
<td style="text-align:center">No</td>
<td style="text-align:center">Write</td>
<td style="text-align:center">0x1236</td>
</tr>
</tbody>
</table>
</div>
<h5 id="5-2-ATT-MTU-Size-Negotiation"><a href="#5-2-ATT-MTU-Size-Negotiation" class="headerlink" title="5.2 ATT MTU Size Negotiation"></a>5.2 ATT MTU Size Negotiation</h5><p>MTU 的size 应该是83，23 也是可以的。</p>
<h4 id="5-3-Characteristic-Key-based-Pairing"><a href="#5-3-Characteristic-Key-based-Pairing" class="headerlink" title="5.3 Characteristic: Key-based Pairing"></a>5.3 Characteristic: Key-based Pairing</h4><p>Provider和Seeker基于一把private key，每次出发pair，public key/private key pair都应该不一样</p>
<h4 id="5-4-Data-format"><a href="#5-4-Data-format" class="headerlink" title="5.4 Data format"></a>5.4 Data format</h4><div class="table-container">
<table>
<thead>
<tr>
<th>Octet</th>
<th>Data type</th>
<th>Description</th>
<th>Value</th>
<th>Mandatory?</th>
</tr>
</thead>
<tbody>
<tr>
<td>0 - 1</td>
<td>uint128</td>
<td>Encrypted Request</td>
<td>varies</td>
<td>Mandatory</td>
</tr>
</tbody>
</table>
</div>
<p>16 - 79    |Public Key|varies|Optional|</p>

          
        
      
    </div>

    

    

    
    
    

    

    
      
    
    

    

    <footer class="post-footer">
      

      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </div>
  
  
  
  </article>

    
        

  
  
  

  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2019/07/10/git-usage/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Wen Wu">
      <meta itemprop="description" content="I'm a bluetooth Host and Controller developer">
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Wen Wu's notes">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
                
                
                <a href="/2019/07/10/git-usage/" class="post-title-link" itemprop="url">常用的git命令</a>
              
            
          </h1>
        

        <div class="post-meta">

          
          
          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              

              
                
              

              <time title="创建时间：2019-07-10 22:37:38" itemprop="dateCreated datePublished" datetime="2019-07-10T22:37:38+08:00">2019-07-10</time>
            </span>
          

          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing"><a href="/categories/GIT/" itemprop="url" rel="index"><span itemprop="name">GIT</span></a></span>

                
                
              
            </span>
          

          
          
            <span id="/2019/07/10/git-usage/" class="post-meta-item leancloud_visitors" data-flag-title="常用的git命令">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              
                <span class="post-meta-item-text">阅读次数：</span>
              
                <span class="leancloud-visitors-count"></span>
            </span>
          

          

          
            
  
  <span class="post-meta-item">
    
    <span class="post-meta-item-icon">
      <i class="fa fa-comment-o"></i>
    </span>
    
      <span class="post-meta-item-text">评论数：</span>
    
  
    <a href="/2019/07/10/git-usage/#comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2019/07/10/git-usage/" itemprop="commentCount"></span>
    </a>
  </span>
  
  
          

          <br>
          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
            <p>介绍git原理的不错的文章： <a href="https://codewords.recurse.com/issues/two/git-from-the-inside-out">git from inside out</a></p>
<ol>
<li>git log —pretty=oneline</li>
<li>git log -1</li>
<li>git rev-parse —git-dir #show the .git folder name</li>
<li>git add . git add filename git add all git add . -A</li>
<li>git commit -s</li>
<li>git commit -m “msg”</li>
<li>git commit —amend # add the current file to the previous change list</li>
<li>git push</li>
<li>git bisect 是用二分法协助RD查找是哪笔check-in导致的错误的，请<a href="http://www.ruanyifeng.com/blog/2018/12/git-bisect.html">参考</a></li>
<li>git diff 文件格式说明，<a href="https://www.jianshu.com/p/98829d4e996f">link</a></li>
<li>git diff HEAD — readme.txt</li>
<li>git reset —hard HEAD^ 用remote端最新code盖掉index区域的改动（已经add到index的改动）</li>
<li>git reset —hard 1094a 指定回到某个版本</li>
<li>git cherry-pick</li>
<li>git reflog 查找使用过的git command<blockquote>
<p>Mac01:BlueShell wnnwoo$ git reflog<br>894474c (HEAD -&gt; master) HEAD@{0}: reset: moving to HEAD^<br>fcdea80 (origin/master) HEAD@{1}: commit: fix build error<br>894474c (HEAD -&gt; master) HEAD@{2}: commit: update basic operation<br>94e2258 HEAD@{3}: commit: Run the scheme testing<br>f305bac HEAD@{4}: commit: add generics test code<br>4acfba7 HEAD@{5}: commit: Add error handle</p>
</blockquote>
</li>
<li>git checkout — readme.txt 丢弃工作区的改动</li>
<li>git reset HEAD readme.txt 暂存区的修改回退到工作区</li>
<li>git diff &gt; abc.diff</li>
<li>git apply abc.diff</li>
</ol>
<p>control + r # search the history command</p>

          
        
      
    </div>

    

    

    
    
    

    

    
      
    
    

    

    <footer class="post-footer">
      

      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </div>
  
  
  
  </article>

    
  </section>

  
  <nav class="pagination">
    <a class="extend prev" rel="prev" href="/page/5/"><i class="fa fa-angle-left" aria-label="上一页"></i></a><a class="page-number" href="/">1</a><span class="space">&hellip;</span><a class="page-number" href="/page/5/">5</a><span class="page-number current">6</span><a class="page-number" href="/page/7/">7</a><a class="page-number" href="/page/8/">8</a><a class="extend next" rel="next" href="/page/7/"><i class="fa fa-angle-right" aria-label="下一页"></i></a>
  </nav>



          </div>
          

        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      

      <div class="site-overview-wrap sidebar-panel sidebar-panel-active">
        <div class="site-overview">

          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  
  <p class="site-author-name" itemprop="name">Wen Wu</p>
  <div class="site-description motion-element" itemprop="description">I'm a bluetooth Host and Controller developer</div>
</div>


  <nav class="site-state motion-element">
    
      <div class="site-state-item site-state-posts">
        
          <a href="/archives/">
        
          <span class="site-state-item-count">80</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
    

    
      
      
      <div class="site-state-item site-state-categories">
        
          
            <a href="/categories/">
          
        
        
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
        <span class="site-state-item-count">16</span>
        <span class="site-state-item-name">分类</span>
        </a>
      </div>
    

    
      
      
      <div class="site-state-item site-state-tags">
        
          
            <a href="/tags/">
          
        
        
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
        <span class="site-state-item-count">39</span>
        <span class="site-state-item-name">标签</span>
        </a>
      </div>
    
  </nav>













          
          
        </div>
      </div>

      

      

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2022</span>
  <span class="with-love" id="animate">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Wen Wu</span>

  

  
</div>


  <div class="powered-by">由 <a href="https://hexo.io" class="theme-link" rel="noopener" target="_blank">Hexo</a> 强力驱动 v3.9.0</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 – <a href="https://theme-next.org" class="theme-link" rel="noopener" target="_blank">NexT.Gemini</a> v7.2.0</div>





  <script src="https://unpkg.com/mermaid@/dist/mermaid.min.js"></script>
  <script>
    if (window.mermaid) {
      mermaid.initialize("");
    }
  </script>



        








        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

    

    

  </div>

  

<script>
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>
















  
  









  
  <script src="/lib/jquery/index.js?v=3.4.1"></script>

  
  <script src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>




  <script src="/js/utils.js?v=7.2.0"></script>

  <script src="/js/motion.js?v=7.2.0"></script>



  
  


  <script src="/js/affix.js?v=7.2.0"></script>

  <script src="/js/schemes/pisces.js?v=7.2.0"></script>




  

  <script src="/js/next-boot.js?v=7.2.0"></script>

  

  

  


  
  

  
  
    
      
    
      
    
      
    
      
    
      
    
      
    
      
    
      
    
      
    
      
    
  

  























<script>
if ($('body').find('pre.mermaid').length) {
  $.ajax({
    type: 'GET',
    url: '//cdn.jsdelivr.net/npm/mermaid@8/dist/mermaid.min.js',
    dataType: 'script',
    cache: true,
    success: function() {
      mermaid.initialize({
        theme: 'forest',
        logLevel: 3,
        flowchart: { curve: 'linear' },
        gantt: { axisFormat: '%m/%d/%Y' },
        sequence: { actorMargin: 50 }
      });
    }
  });
}
</script>


<script>
// GET RESPONSIVE HEIGHT PASSED FROM IFRAME

window.addEventListener("message", function(e) {
  var data = e.data;
  if ((typeof data === 'string') && (data.indexOf('ciu_embed') > -1)) {
    var featureID = data.split(':')[1];
    var height = data.split(':')[2];
    $(`iframe[data-feature=${featureID}]`).height(parseInt(height) + 30);
  }
}, false);
</script>








  
    

  

<script src="//cdn.jsdelivr.net/npm/valine@1/dist/Valine.min.js"></script>

<script>
  var GUEST = ['nick', 'mail', 'link'];
  var guest = 'nick,mail,link';
  guest = guest.split(',').filter(function(item) {
    return GUEST.indexOf(item) > -1;
  });
  new Valine({
    el: '#comments',
    verify: false,
    notify: false,
    appId: 'wteo2C9GdG6F2N92cktVar8K-gzGzoHsz',
    appKey: 'IBKrtkUwlKqPJ8FQsKkNP0K1',
    placeholder: 'Just go go',
    avatar: 'mm',
    meta: guest,
    pageSize: '10' || 10,
    visitor: true,
    lang: 'zh-cn' || 'zh-cn'
  });
</script><!-- hexo-inject:begin --><!-- Begin: Injected MathJax -->
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({"tex2jax":{"inlineMath":[["$","$"],["\\(","\\)"]],"skipTags":["script","noscript","style","textarea","pre","code"],"processEscapes":true},"TeX":{"equationNumbers":{"autoNumber":"AMS"}}});
</script>

<script type="text/x-mathjax-config">
  MathJax.Hub.Queue(function() {
    var all = MathJax.Hub.getAllJax(), i;
    for(i=0; i < all.length; i += 1) {
      all[i].SourceElement().parentNode.className += ' has-jax';
    }
  });
</script>

<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js">
</script>
<!-- End: Injected MathJax -->
<!-- hexo-inject:end -->

  

</body>
</html>
